package net.huashitong.ssydt.provider.pk.service;


import net.huashitong.ssydt.base.dao.LongMapper;
import net.huashitong.ssydt.base.service.AbstractLongService;
import net.huashitong.ssydt.pk.entity.SsPkYzddMedalRank;
import net.huashitong.ssydt.provider.pk.mapper.SsPkYzddMedalRankMapper;
import net.huashitong.ssydt.provider.vo.BaseLongIdPagingVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.12.20
 */
@Service
@Transactional
public class SsPkYzddMedalRankServiceImpl extends AbstractLongService<SsPkYzddMedalRank> implements SsPkYzddMedalRankService {

    private SsPkYzddMedalRankMapper mapper;

    @Autowired
    public SsPkYzddMedalRankServiceImpl(SsPkYzddMedalRankMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    protected LongMapper<SsPkYzddMedalRank> getLongMapper() {
        return this.mapper;
    }

    @Override
    public SsPkYzddMedalRank getByUserId(String userId) {
        return this.mapper.getByUserId(userId);
    }

    @Override
    public List<SsPkYzddMedalRank> query(BaseLongIdPagingVO baseLongIdPagingVO) {
        return this.mapper.query(baseLongIdPagingVO);
    }

    @Override
    public int deleteAll() {
        return this.mapper.deleteAll();
    }

    @Override
    public int batchInsert(List<SsPkYzddMedalRank> ranks) {
        if (ranks.isEmpty()) {
            return 0;
        }
        return this.mapper.batchInsert(ranks);
    }
}
